﻿using System.Windows.Input;
using Red.Controls.ViewModels;

namespace Red.Toolkit.NodeDeclaratorEditor
{
    public class DataButtonItemBase : DataItem
    {
        #region Data

        private readonly string _name;

        #endregion Data

        #region C-tor

        public DataButtonItemBase( DataItem parent, string name, ICommand action, object parameter = null )
            : base( parent )
        {
            ActionParameter = parameter;
            Action = action;
            _name = name;
            IsExpanded = true;
        }

        #endregion C-tor

        #region DataItem implementation

        public override string Type => "Action";

        public override string Value
        {
            get { return _name; }
            set { }
        }

        public override DataItemKind Kind => DataItemKind.Compound;

        public ICommand Action { get; }

        public object ActionParameter { get; }

        #endregion DataItem implementation
    }
}




